<template>
	<view class="withdrawRecord">  
		<view class="withdrawRecordBox me-fx-row-sb-c" v-for="(item, index) in indexDataList" >
			<view class="withdrawRecordBoxLeft me-fx-row-start-c">
				<image src="../../static/img/Withdrawal.png" mode="" v-if="item.type == '2'"></image>
				<image src="../../static/img/Recharge.png" mode="" v-else></image>
				<view class="tixianBox">
					<view class="tixianName" v-if="item.type == '2'">
						支付宝提现
					</view>
					<view class="tixianName" v-else>
						微信提现
					</view>
					<view class="tixianTime">
						{{item.created_at}}
					</view>
				</view>
			</view>
			<view class="withdrawRecordBoxRight me-fx-row-start-c">
				<view class="money">
					{{item.money}}￥
				</view>
			</view>
		</view>
		
	</view>
</template>
	
<script>
	export default {
		data() {
			return {
				dataList:[],
				page:1,
				last_page:1,
				indexDataList:[]
			}
		},
		created(){
			this.dataListBtn(this.page)
		},
		methods: {
			dataListBtn(page){
					this.$u.get('/wallet/log/deposit/'+page).then(res => {
							if (res) {
								console.log(res,'res')
								
								this.last_page = res.data.list.last_page
								if (res.data.list.current_page == 1) {
									this.indexDataList = res.data.list.data
								} else {
									this.indexDataList = this.indexDataList.concat(res.data.list.data)
								}
							}
						})
						.catch((res) => {
							console.log(res.message)
						})
			},
			onReachBottom(){//uniapp 监听下拉加载生命周期
			if(this.page>=this.last_page){
				uni.showToast({
					title: '没有更多数据了',
					duration: 1000,
					icon: 'none'
				})
				return
			}
			this.page++
			this.dataListBtn(this.page)
			},
		}
	}
</script>

<style>
	.withdrawRecordBox{
		padding: 0 30rpx;
		height: 172rpx;
		border-bottom: 1rpx solid rgba(245,245,245,1);
		}
		.withdrawRecordBoxLeft image{
			width:90rpx;
			height:90rpx;
			background:rgba(129,129,234,1);
			border-radius:45rpx;
		}
		.tixianBox{
			margin-left: 23rpx;
		}
		.tixianBox .tixianName{
			font-size:32rpx;
			font-weight:bold;
			color:rgba(33,33,33,1);
		}
		.tixianBox .tixianTime{
			font-size:28rpx;
			color:rgba(101,101,101,1);
			margin-top: 20rpx;
		}
		.withdrawRecordBoxRight .money{
			font-size:32rpx;
			color:rgba(33,33,33,1);
		}
		
</style>
